﻿
<% content_for :css do %>
  <%= stylesheet_link_tag "search", :media => "all" %>
  <%= stylesheet_link_tag "home/news2Style", :media => "all" %>
<%end%>
<!--header(end)-->
<!--main(start)-->
<div class="main">
  <div class="top">
    <span class="n_gray fistPage"><a href="<%=root_path%>">首页</a></span>
    <span class="n_gray">></span>
    <span>搜索页面</span>
  </div>
  <div class="right_top">
    <%=form_tag search_index_path, method: :get, class: 'research' do  %>
    <span class="searchBtn">
      <input type="text" name='q[keywords]' class='keywords' value="<%=@query[:keywords] %>" />
      <i class='submit'></i>
      <span class="high_search"><a href="<%=advanced_search_index_path %>">高级搜索</a></span>
    </span>
    <% end %>
    <span class="right_title">搜索结果</span>
  </div>
  <div class="content">
    <ul>
      <% @news.each do |n| %>
      <li>
        <a target="_blank" href="<%= news_path(n.id) %>">
          <span class="time"><%=n.pubtime.strftime("%Y-%m-%d") %></span>
          <span class="content_icon"></span>
          <span><%= n.title %><%= "[图文]" if check_image_src n%></span>
        </a>
      </li>
      <% end %>
      <%if @news.blank? %>
          <li>暂无记录</li>
      <%end  %>
    </ul>
    <%if !@news.blank? %>
        <div class="count">
          <%= paginate @news %>
          <div style="display: -webkit-inline-box;
                  position: absolute;
                  margin-top: 28px;
                  margin-left: 12px;">共<%=@news_count   %>条记录</div>
        </div>
    <%end  %>
  </div>
</div>
<!--main(end)-->